#ifndef LINKEREDITWIDGET_H
#define LINKEREDITWIDGET_H

#include <QWidget>
#include "EditorWidgets/searchlineedit.h"
#include "GameData/gamedata.h"
#include <QPushButton>
#include "EditorWidgets/linkeritem.h"
#include "Linker/linker.h"
#include "gamemanager.h"
namespace Ui {
class LinkerEditWidget;
}

class LinkerEditWidget : public QWidget
{
    Q_OBJECT

public:
    explicit LinkerEditWidget(QWidget *parent = nullptr);
    ~LinkerEditWidget();
    void SetName(QString name);
    void AddConditionItem();
    void AddConditionItem(Condition* c);
    void AddActionItem();
    void AddActionItem(Action* a);
    int curRow = -1;
    //读取当前linker并显示出来
    void ReadNodeLinker();
protected:
    void closeEvent(QCloseEvent *event);
private:
    Ui::LinkerEditWidget *ui;
    void SaveBtn();
    //清除两个列表窗口中的内容
    void ClearList();
private slots:
    void DeleteCurItem(QListWidget* w);
};

#endif // LINKEREDITWIDGET_H
